package cs383.GradUnit;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import android.util.Log;

public class cTable {
	
	private int dealerButton;
	private int smallBlindIndex;
	private int largeBlindIndex;
	
	private int numberOfActivePlayers;
	private int numberOfPlayersInHand;
	private int numberOfPlayersToAct;
	private int numberOfAllInPlayers;
	
	private int currentPot;
	private int currentBet;
	private int minBet;
	private int currentMinBet;
	
	private int currentBettingRound;
	private int roundNumber;
	
	private Deck pokerDeck;
	private HandEvaluator handEvaluator;
	private HoleCardRanker holeCardRanker;
	
	private ArrayList<cPlayer> playerList;
	public ArrayList<Card> communityCards;
	
	cTable(){
		minBet = 0;
		currentMinBet = 0;
		currentBet = 0;
		currentPot = 0;
		numberOfActivePlayers = 4;
		numberOfPlayersInHand = 0;
		numberOfPlayersToAct = 0;
		numberOfAllInPlayers = 0;
		roundNumber = 0;
		
		handEvaluator = new HandEvaluator();
		holeCardRanker = new HoleCardRanker();
		
		playerList = new ArrayList<cPlayer>();
		playerList.add(new cPlayer(1000));
		playerList.add(new cPlayer(1000));
		playerList.add(new cPlayer(1000));
		playerList.add(new cPlayer(1000));
		
		pokerDeck = new Deck(0);
		communityCards = new ArrayList();
		
		Random randomGenerator = new Random();
    	dealerButton = randomGenerator.nextInt(4);
	}
	void handInitialization(){
		numberOfPlayersInHand = numberOfActivePlayers;
		numberOfAllInPlayers = 0;
		numberOfPlayersToAct = numberOfPlayersInHand - numberOfAllInPlayers;
		
		for(int i = 0; i < 4; i ++){
			if(playerList.get(i).inGame){
				playerList.get(i).inHand = true;
				playerList.get(i).allIn = false;
				playerList.get(i).holeCards.clear();
				playerList.get(i).resetChipsInRound();
				playerList.get(i).resetChipsInHand();
			}
		}
		currentPot = 0;
		currentBet = 0;
		if(currentBettingRound % 7 == 0)  //every 7 hands raise the blinds
			minBet += 10;
		currentMinBet = minBet/2;  //first 2 rounds the min is the small blind (minBet/2)
		currentBettingRound = 1;
		roundNumber++;
		
		communityCards.clear();
		
		pokerDeck.reset();
		pokerDeck.shuffle();
		
		Log.d("cTable.handInitialization()", "Initialized hand");
		Log.d("cTable.handInitialization()", "	Number of players in game: " + numberOfActivePlayers);
		Log.d("cTable.handInitialization()", "	Number of all-in players: " + numberOfAllInPlayers);
		Log.d("cTable.handInitialization()", " Number of players in hand: " + numberOfPlayersInHand);
		Log.d("cTable.handInitialization()", "	Number of players left to act: " + numberOfPlayersToAct);
	}
	void incrementBettingRound(){
		currentBettingRound++;
		if(currentBettingRound > 2)
			currentMinBet = minBet;
		
		currentBet = 0;
		updatePlayersToActCounter();
		//numberOfPlayersToAct = numberOfPlayersInHand - numberOfAllInPlayers;
		if(numberOfPlayersToAct <= 1)  //if only one player has a chance to make a decision, they don't get to and the hand plays out
			numberOfPlayersToAct = 0;
		
		for(int i = 0; i < 4; i ++){
			playerList.get(i).resetChipsInRound();
		}
	}
	void addToPot(int bet){
		currentPot+=bet;
	}
	void refundChips(int playerNum, int chips){
		currentPot -= chips;
		playerList.get(playerNum).refundChips(chips);
	}
	int getCurrentRoundNumber(){
		return roundNumber;
	}
	int getBettingRound(){
		return currentBettingRound;
	}
	
	void setMinBet(int amount){
		minBet = amount;
	}
	
	int getMinBet(){
		return currentMinBet;
	}
	
	
	int getCurrentPot(){
		return currentPot;
	}
	/**
	 * returns the amount of the currently placed bet
	 */
	int getCurrentBet(){
		return currentBet;
	}
	
	/**
	 * Gives the position of the dealer button
	 * 
	 * @return Returns the integer index of the dealer button
	 */
	int getDealerButton(){
		return dealerButton;
	}
	
	/**
	 * Gives the position of the small blind player
	 * 
	 * @return Returns the integer index of the small blind player
	 */
	int getSmallBlindIndex(){
		return smallBlindIndex;
	}
	
	/**
	 * Gives the position of the large blind player
	 * 
	 * @return Returns the integer index of the large blind player
	 */
	int getLargeBlindIndex(){
		return largeBlindIndex;
	}
	int getPlayerCardIndex(int playerNum, int cardNum){
		return playerList.get(playerNum).holeCards.get(cardNum).getIndex();
	}
	int getCommunityCardIndex(int cardNum){
		return communityCards.get(cardNum).getIndex();
	}
	
	int getPlayerChipAmount(int playerNumber){
		return playerList.get(playerNumber).getChipAmount();
	}
	
	int getNumberOfAllInPlayers(){
		return numberOfAllInPlayers;
	}
	/**
	 * Return to Activity the number of chips a player has in the round
	 * 
	 * @param playerNum The index of the specified player
	 * @return The amount of chips the specified player has in the round
	 */
	int getPlayerChipsInRound(int playerNum){
		return playerList.get(playerNum).getChipsInRound();
	}
	
	int getNumberOfActivePlayers(){
		return numberOfActivePlayers;
	}
	int getNumberOfPlayersInHand(){
		return numberOfPlayersInHand;
	}
	/**
	 * 
	 * @return Returns, as an int, the number of players that haven't made a decision yet 
	 *   in the current round
	 */
	int getNumberOfPlayersToAct(){
		return numberOfPlayersToAct;
	}
	
	double getPlayerDecision(int playerNum){
		int rank;
		double playerChoice = -1;
		if(currentBettingRound == 1){
			rank = HoleCardRanker.rankPair( playerList.get(playerNum).holeCards.get(0), playerList.get(playerNum).holeCards.get(1));
			playerChoice = cBehaviorModule.makeDecision(rank, currentBettingRound, currentBet);  
		}
		else{
			Hand communityCardsHand = new Hand();
			for(int i = 0; i < communityCards.size(); i++){
				communityCardsHand.addCard(communityCards.get(i));	
			}
			rank = handEvaluator.rankHand(playerList.get(playerNum).holeCards.get(0), playerList.get(playerNum).holeCards.get(1), communityCardsHand );
			playerChoice = cBehaviorModule.makeDecision(rank/371293, currentBettingRound, currentBet);  
		}
		
    	
    	
    	if(playerChoice == cBehaviorModule.CALL){
    		if(currentBet == 0){
    			raise(playerNum, currentMinBet/getPlayerChipAmount(playerNum));
    			return cBehaviorModule.RAISE;
    		}
    		else{
    			call(playerNum);
    			return playerChoice;
    		}
    		
    	}
    	else if (playerChoice == cBehaviorModule.CHECK){
    		check(playerNum);
    		return playerChoice;
    	}
    	else if(playerChoice == cBehaviorModule.FOLD){
    		fold(playerNum);
    			return playerChoice;
    	}
    	else{  //raise
    		
    		//** What if all other players are all in? **
    		if(numberOfActivePlayers - numberOfAllInPlayers == 1){
    			//just call the all in bet
    			call(playerNum);
    			return cBehaviorModule.CALL;
    		}
    		raise(playerNum,playerChoice);
    		return playerChoice;
    	}
	}
	void moveDealerButton(){
    	//numberOfPlayersInHand = numberOfActivePlayers;
    	
    	for(int i = dealerButton+1; i < dealerButton +1 + 4; i++){
			int curPlayer = i % 4;
			if(playerList.get(curPlayer).inGame == true){
				dealerButton = curPlayer;
				break;
			}
		}
    	
    	for(int i = dealerButton+1; i < dealerButton + 1 + 4; i++){
			int curPlayer = i % 4;
			if(playerList.get(curPlayer).inGame == true){
				smallBlindIndex = curPlayer;
				break;
			}
		}
    	
    	for(int i = smallBlindIndex+1; i < smallBlindIndex + 1 + 4; i++){
			int curPlayer = i % 4;
			if(playerList.get(curPlayer).inGame == true){
				largeBlindIndex = curPlayer;
				break;
			}
		}
    	
    	Log.d("moveDealerButton","Dealer button on Player "+dealerButton);
    	Log.d("moveDealerButton", "Small Blind: "+smallBlindIndex);
    	Log.d("moveDealerButton", "Large Blind: "+largeBlindIndex);
    	takeBlinds(smallBlindIndex,largeBlindIndex);
    	
    	
    	
    }
	private void takeBlinds(int smallBlind, int largeBlind){
    	takeSmallBlind(smallBlind);
    	takeLargeBlind(largeBlind);
    }
	
	void placeHumanBet(int chipAmount){
		playerList.get(0).takeChips(chipAmount);
		if(currentBet < chipAmount)
			currentBet = chipAmount;
		currentPot+=chipAmount;
	}
	
	
	
	
	boolean checkPlayerInHand(int playerNum){
		if(playerList.get(playerNum).inHand == true)// && playerList.get(playerNum).allIn == false)
			return true;
		else
			return false;
	}
	
	/**
	 * Checks if the specified player is still in the game.
	 * 
	 * @param playerNum Index of specified player.
	 * @return True if player is still in game, False if they've lost.
	 */
	boolean checkPlayerInGame(int playerNum){
		if(playerList.get(playerNum).inGame)
			return true;
		else
			return false;
	}
	
	/**
	 * 
	 * @param playerNum Index of specified player
	 * @return True if player is all in, False if they aren't
	 */
	boolean checkPlayerAllIn(int playerNum){
		if(playerList.get(playerNum).allIn)
			return true;
		else
			return false;
	}
	
	/**
	 * Takes the "small blind" amount from the specified player
	 * 
	 * @param playerNum The index for the current player.
	 */
	void takeSmallBlind(int playerNum){
		currentPot += minBet/2;
		currentBet = minBet/2;
		playerList.get(playerNum).takeChips(minBet/2);
		//numberOfPlayersToAct--;
		
	}
	
	/**
	 * Takes the "large blind" amount from the specified player.
	 * 
	 * @param playerNum The index for the current player.
	 */
	void takeLargeBlind(int playerNum){
		currentPot += minBet;
		currentBet = minBet;
		playerList.get(playerNum).takeChips(minBet);
		//numberOfPlayersToAct--;
	}
	
	void check(int playerNum){
		Log.d("cTable.check", "Players left to act: " + numberOfPlayersToAct);
		numberOfPlayersToAct--;
		Log.d("cTable.check", "Players left to act: " + numberOfPlayersToAct);
	}
	/*
	void check(){
		numberOfPlayersToAct--;
		Log.d("cTable.fold", "Players left to act: " + numberOfPlayersToAct);
	}
	*/
	
	/** updatePlayersToActCounter()
	 * 
	 * Resets the numberOfPlayersToAct counter at the start of a new hand or new round
	 */
	void updatePlayersToActCounter(){
		numberOfPlayersToAct = numberOfPlayersInHand - numberOfAllInPlayers;
		
		if(numberOfPlayersToAct<0) {numberOfPlayersToAct = 0;}
	}
	
	/** updatePlayersToActCounter(int playerNum)
	 * 
	 * Updates the numberOfPlayersToAct counter after a player makes a decision
	 * 
	 * @param playerNum The integer index for the player
	 */
	void updatePlayersToActCounter(int playerNum){
		//Log.d("updatePlayersToActCounter", "   number of players in hand: " + numberOfPlayersInHand);
		//Log.d("updatePlayersToActCounter", "   number of all in players: " + numberOfAllInPlayers);
		if(checkPlayerAllIn(playerNum))  //if the player is all in, subtracting the one causes an off by one error
		{	
			numberOfPlayersToAct = numberOfPlayersInHand - numberOfAllInPlayers;
			//Log.d("updatePlayersToActCounter", "   updated players to act with all in logic for player " + (playerNum+1));
		}
		else{
			numberOfPlayersToAct = numberOfPlayersInHand - numberOfAllInPlayers -1;
			//Log.d("updatePlayersToActCounter", "   updated players to act with regular logic for player " + (playerNum+1));
		}
		
		if(numberOfPlayersToAct<0){numberOfPlayersToAct = 0;}
	}
	
	/**
	 * "folds" the specified player out of the current hand
	 * 
	 * @param playerNum the index for the player making a decision
	 */
	void fold(int playerNum){
		Log.d("cTable.fold", "Player " + (playerNum+1) + " folds");
		playerList.get(playerNum).inHand = false;
		playerList.get(playerNum).holeCards.clear();
		numberOfPlayersToAct--;
		numberOfPlayersInHand--;
		Log.d("cTable.fold", "Players left to act: " + numberOfPlayersToAct);
		
	}
	
	/**
	 * "calls" the current bet amount for the specified player
	 * 
	 * This method takes an amount of chips, matching the current bet,
	 *  out of the specified player's chips and adds it to the current pot
	 * 
	 * @param playerNum the index for the player making a decision
	 */
	void call(int playerNum){
		Log.d("cTable.call", "Player " + (playerNum+1) + " calls");
		int playerChips = playerList.get(playerNum).getChipAmount();
		int chipsNeededToCall = currentBet - playerList.get(playerNum).getChipsInRound();
		
		if(playerChips > chipsNeededToCall ){  									// if the player can cover the call
			playerList.get(playerNum).takeChips(chipsNeededToCall);
			currentPot += chipsNeededToCall;
			//updatePlayersToActCounter(playerNum);
			numberOfPlayersToAct--;
		}
		else{  															// ALL-IN if they can't cover the bet
			currentPot += playerList.get(playerNum).getChipAmount();
			playerList.get(playerNum).goAllIn();
			numberOfAllInPlayers++;
			//updatePlayersToActCounter(playerNum);
			numberOfPlayersToAct--;
		}
		Log.d("cTable.call", "Players left to act: " + numberOfPlayersToAct);
	}
	
	/**
	 * "Raises" the current bet to the specified amount
	 * 
	 * This method allows the user to raise the current bet.  The maximum value is however many
	 *   chips the player has.  
	 * 
	 * @param playerNum The index of the specified player.
	 * @param amount The percentage of their chips the specified player will raise to.
	 */
	void raise(int playerNum, double amount){
		//Log.d("raise", "Players left to act before the raise" + numberOfPlayersToAct);
		//Log.d("raise", "Player "+playerNum + " is raising");
		
		/*  If the user(player0) uses this method, amount is an actual chip amount
		 *   otherwise, it is the % of chips the computer player wants to bet
		 */
		int amountToRaise;
		if(playerNum != 0)
			amountToRaise =  (int)(playerList.get(playerNum).getChipAmount() * amount);  //calculates the amount of chips to raise
		else
			amountToRaise = (int)amount;
		
		if(amountToRaise > currentBet){  				//if the raise amount is actually a raise
			
			currentBet = amountToRaise;
			currentPot += (amountToRaise - playerList.get(playerNum).getChipsInRound());   /*adds to the pot the difference between the amount
																						 they choose to raise and the amount they already have bet */
			playerList.get(playerNum).takeChips(amountToRaise - playerList.get(playerNum).getChipsInRound());  //takes the chips from the player
		
			if(getPlayerChipAmount(playerNum) <= 0){  //check if the raise was a 100% raise which is an all-in
				playerList.get(playerNum).goAllIn();
				numberOfAllInPlayers++;
				
			}
			updatePlayersToActCounter(playerNum);
		}
		else{  							//if the specified raise amount isn't greater than current min bet
			amountToRaise = currentBet + currentMinBet;   //raise amount will then become current bet + the min bet
			if((amountToRaise - playerList.get(playerNum).getChipsInRound()) < playerList.get(playerNum).getChipAmount()){  //if the new raise amount can be covered by the player
				currentBet = amountToRaise;
				currentPot += (amountToRaise - playerList.get(playerNum).getChipsInRound());
				playerList.get(playerNum).takeChips(amountToRaise - playerList.get(playerNum).getChipsInRound());
				updatePlayersToActCounter(playerNum);
			}
			else{  										//if the new raise amount can't be covered, go all-in
				currentPot += playerList.get(playerNum).getChipAmount();
				playerList.get(playerNum).goAllIn();
				numberOfAllInPlayers++;
				numberOfPlayersToAct--;     //if the player goes all in because they can't cover the bet, the counter doesnt need reset, just decremented
			}
			 
		}
		
		Log.d("cTable.raise", "Players left to act: " + numberOfPlayersToAct);
	}
	
ArrayList awardPot(){
		
		ArrayList<cRank> first = new ArrayList();
		
		if(numberOfPlayersInHand == 1){
			for(int i = 0; i < 4; i ++){
				if(playerList.get(i).inHand){
					playerList.get(i).awardChips(currentPot);
					//int rank = HoleCardRanker.rankPair(playerList.get(i).holeCards.get(0), playerList.get(i).holeCards.get(1));
					Hand hand = new Hand();
					hand.addCard(playerList.get(i).holeCards.get(0));
					hand.addCard(playerList.get(i).holeCards.get(1));
					for(int j = 0; j < communityCards.size(); j++){
						hand.addCard(communityCards.get(j));
					}
					int rank = HandEvaluator.rankHand(hand);
					first.add(new cRank(i,rank,playerList.get(i).getChipsInHand()));
					return first;
				}
			}
		}
		else{
			ArrayList<cRank> playerRanks = new ArrayList();
			playerRanks.add(new cRank(0,-1,0));
			playerRanks.add(new cRank(1,-1,0));
			playerRanks.add(new cRank(2,-1,0));
			playerRanks.add(new cRank(3,-1,0));
			
			Hand communityCardsHand = new Hand();
			for(int i = 0; i < communityCards.size(); i++){
				communityCardsHand.addCard(communityCards.get(i));	
			}
			//build ranks
			for(int i = 0; i < 4; i ++){
				if(playerList.get(i).inHand && playerList.get(i).inGame)
				{
					int r = handEvaluator.rankHand(playerList.get(i).holeCards.get(0), playerList.get(i).holeCards.get(1), communityCardsHand );
					playerRanks.get(i).handRank = r;
					playerRanks.get(i).chips = playerList.get(i).getChipsInHand();
				}
			}
			
			Collections.sort(playerRanks);
			for(int i = 0; i < 4; i ++){
				Log.d("cTable.awardPot", "Player " + playerRanks.get(i).playerIndex + " Rank " + playerRanks.get(i).handRank);
			}
			
			
			ArrayList<cRank> second = new ArrayList();
			ArrayList<cRank> third = new ArrayList();
			ArrayList<cRank> fourth = new ArrayList();
			// Assumes sorted ranks
			for(int i = 3; i >= 0; i --){
				if(first.size() == 0 || (playerRanks.get(i).handRank == first.get(0).handRank) )
					first.add(playerRanks.get(i));
				else{
					if(second.size() == 0 || (playerRanks.get(i).handRank == second.get(0).handRank))
						second.add(playerRanks.get(i));
					else{
						if(third.size() == 0 || (playerRanks.get(i).handRank == third.get(0).handRank) ){
							third.add(playerRanks.get(i));
						}
						else{
							if(fourth.size() == 0 || (playerRanks.get(i).handRank == fourth.get(0).handRank)){
								fourth.add(playerRanks.get(i));
							}
						}
					}
				}
			}
		/*
			//Do the awarding
			int totPot = currentPot;
			for(int i = 0; i < first.size(); i++){  //calculate the pot for each player ranked as first
				cRank curRank = first.get(i);  //get the rank object
				
				int pot = playerList.get(curRank.playerIndex).getChipsInHand(); totPot -= pot;  
				int betToMatch = playerList.get(curRank.playerIndex).getChipsInHand();
				for(int  j= 0; j < 4; j++){
					if(j != curRank.playerIndex){
						if(playerList.get(j).getChipsInHand() >= betToMatch){
							pot += betToMatch;
							totPot -= betToMatch;
						}
						else{
							pot += playerList.get(j).getChipsInHand();
							totPot -= playerList.get(j).getChipsInHand();
						}
					}
				}
			
				playerList.get(curRank.playerIndex).awardChips(pot/first.size());
			}
			*/
			
			/* new awarding */
			int amountAwarded = 0;
			for(int i = 0; i < first.size(); i++){
				//award the first place people
				int chipsToAward = 0;
				int chipsToTake = first.get(i).chips;
				System.out.println("Doing player " + (first.get(i).playerIndex+1) + ": taking " + chipsToTake);
			//collect chips	
				for(int j = i; j < first.size(); j++){
					first.get(j).chips -= chipsToTake;
					chipsToAward+= chipsToTake;
				}
				for(int j = 0; j < second.size(); j++){
					second.get(j).chips -= chipsToTake;
					chipsToAward+= chipsToTake;
				}
				for(int j = 0; j < third.size(); j++){
					third.get(j).chips -= chipsToTake;
					chipsToAward+= chipsToTake;
				}
				for(int j = 0; j < fourth.size(); j++){
					fourth.get(j).chips -= chipsToTake;
					chipsToAward+= chipsToTake;
				}
		    //award chips
				int tmp = chipsToAward/(first.size()-i);
				for(int j = i; j < first.size(); j++){
					if(tmp > currentPot){
						playerList.get(first.get(j).playerIndex).awardChips(currentPot);
						amountAwarded = currentPot;
					}
					else{
						playerList.get(first.get(j).playerIndex).awardChips(tmp);
						amountAwarded += tmp;
					}
				}
				
			}
			if(amountAwarded < currentPot){
				for(int i = 0; i < second.size(); i++){
					//award the first place people
					int chipsToAward = 0;
					int chipsToTake = second.get(i).chips;
					System.out.println("Doing player " + (second.get(i).playerIndex+1) + ": taking " + chipsToTake);
				//collect chips	
					for(int j = i; j < second.size(); j++){
						second.get(j).chips -= chipsToTake;
						chipsToAward+= chipsToTake;
					}
					for(int j = 0; j < third.size(); j++){
						third.get(j).chips -= chipsToTake;
						chipsToAward+= chipsToTake;
					}
					for(int j = 0; j < fourth.size(); j++){
						fourth.get(j).chips -= chipsToTake;
						chipsToAward+= chipsToTake;
					}
			    //award chips
					int tmp = chipsToAward/(second.size()-i);
					for(int j = i; j < second.size(); j++){
						playerList.get(second.get(j).playerIndex).awardChips(tmp);
						amountAwarded += tmp;
					}
					
				}
			}
			if(amountAwarded < currentPot){
				for(int i = 0; i < third.size(); i++){
					//award the third place people
					int chipsToAward = 0;
					int chipsToTake = third.get(i).chips;
					System.out.println("Doing player " + (third.get(i).playerIndex+1) + ": taking " + chipsToTake);
				//collect chips	
					for(int j = i; j < third.size(); j++){
						third.get(j).chips -= chipsToTake;
						chipsToAward+= chipsToTake;
					}
					for(int j = 0; j < fourth.size(); j++){
						fourth.get(j).chips -= chipsToTake;
						chipsToAward+= chipsToTake;
					}
			    //award chips
					int tmp = chipsToAward/(third.size()-i);
					for(int j = i; j < third.size(); j++){
						playerList.get(third.get(j).playerIndex).awardChips(tmp);
						amountAwarded += tmp;
					}
					
				}
			}
			if(amountAwarded < currentPot){
				for(int i = 0; i < fourth.size(); i++){
					//award the third place people
					int chipsToAward = 0;
					int chipsToTake = fourth.get(i).chips;
					System.out.println("Doing player " + (fourth.get(i).playerIndex+1) + ": taking " + chipsToTake);
				//collect chips	
					for(int j = i; j < fourth.size(); j++){
						fourth.get(j).chips -= chipsToTake;
						chipsToAward+= chipsToTake;
					}
			    //award chips
					int tmp = chipsToAward/(fourth.size()-i);
					for(int j = i; j < fourth.size(); j++){
						playerList.get(fourth.get(j).playerIndex).awardChips(tmp);
						amountAwarded += tmp;
					}
					
				}
			}
			
			// If a player is out of chips, they are out of the game
			for(int i = 0; i < 4; i++){
				if(getPlayerChipAmount(i) <= 0 && playerList.get(i).inGame == true)
				{
					playerList.get(i).inGame = false;
					playerList.get(i).allIn = false;
					numberOfActivePlayers--;
				}
			}
		}
		return first;
		
	}

	void dealCard(int playerNum){
		Card newCard = pokerDeck.dealCard();
		playerList.get(playerNum).holeCards.add(newCard);
		Log.d("cTable.dealCard()", "Dealt a card");
	}
	
	void flop(){
		pokerDeck.dealCard();
		Card flop1 = pokerDeck.dealCard();
		Card flop2 = pokerDeck.dealCard();
		Card flop3 = pokerDeck.dealCard();
		
		communityCards.add(flop1);
		communityCards.add(flop2);
		communityCards.add(flop3);
	}
	
	void turn(){
		pokerDeck.dealCard();
		Card turn = pokerDeck.dealCard();
		
		communityCards.add(turn);
	}
	
	void river(){
		pokerDeck.dealCard();
		Card river = pokerDeck.dealCard();
		
		communityCards.add(river);
	}
}
